{% extends 'examples/base.html' %}

{% load i18n markup components example_tags %}

{% block title %}{{ obj }} | {{ block.super }}{% endblock %}

{% block content_class %}blog-detail{% endblock %}

{% block content %}
    <!--begin primary-column-->
    <article class="entry-post">
        <header class="entry-header">
            <h1>{{ obj }} {% if not obj.approved %}<span class="label label-important">{% trans "Draft" %}</span>{% endif %}</h1>
            <div class="byline">
                <a href="{{ obj.author.get_absolute_url }}"><i class="fa fa-pencil"></i> {{ obj.author }}</a> &nbsp;&nbsp;
                <i class="fa fa-clock-o"></i> {{ obj.created|date:'DATE_FORMAT' }} &nbsp;&nbsp;
                <a href="{{ obj.topic.get_absolute_url }}"><i class="fa fa-comment"></i> {{ obj.topic.reply_count }} {% blocktrans count counter=obj.topic.reply_count|default:0 %}comment{% plural %}comments{% endblocktrans %}</a>
            </div>
            <div class="entry-meta">
                <i class="fa fa-folder-open"></i> <a href="{% url 'examples:index' %}">{% trans "Recipes" %}</a> - <a href="{{ obj.category.get_absolute_url }}">{{ obj.category }}</a>

                {% if user.is_superuser %}
                <a class="pull-right" href="{% url 'admin:examples_example_change' obj.pk %}" style="margin-left: 10px;">
                    <i class="fa fa-pencil"></i> {% trans "Edit" %}
                </a>
                {% else %}
                    {% if obj|can_edit:user %}
                    <a class="pull-right" href="{% url "examples:edit" obj.id %}" style="margin-left: 10px;">
                        <i class="fa fa-pencil"></i> {% trans "Edit" %}
                    </a>
                    {% endif %}
                {% endif %}

                <a class="pull-right" href="{{ obj.topic.get_absolute_url }}">
                    <i class="fa fa-comment"></i> {% trans "Discuss this recipe" %}
                </a>
            </div>

            <!--add this share buttons for mobile viewers-->
            {% include '_addthis.html' %}
        </header>
        <!--end entry-header-->

        <div class="entry-content">
            {{ obj.content|markdown:"safe" }}
        </div>
        <!--end entry-content-->

        {% comment %}
        <div class="entry-tags"> Tags:<br class="clear">
            <a href="#">people</a> <a href="#">open source</a> <a href="#">indie thought</a> <a href="#">goodness</a>
        </div>
        {% endcomment %}

        <footer class="entry-footer">
            {{ obj.created|pretty_date:'blog' }}

            {% include '_addthis.html' %}
        </footer>
        <!--end entry-footer-->

    </article>
    <!--end entry-post -->

    {% include "_yandex.html" %}

    <div class="entry-pagination">
        <ul class="pager">
            {% with prev=obj.get_prev %}
                {% if prev %}<li><a href="{{ prev.get_absolute_url }}">← {% trans "older"|capfirst %}</a></li>{% endif %}
            {% endwith %}
            {% with next=obj.get_next %}
                {% if next %}<li><a href="{{ next.get_absolute_url }}">{% trans "newer"|capfirst %} →</a></li>{% endif %}
            {% endwith %}
        </ul>
        <!--close pager-->
    </div>
    <!--end entry-pagination-->

    {% comment %}
    <div class="entry-related">
        <h4 class="short_headline"><span>Related Articles</span></h4>
        <ul class="navigation">
            <li> <a href="#"> Lorem ipsum dolor sit amet </a> </li>
            <li> <a href="#"> Nam sed orci massa quis placerat libero </a> </li>
            <li> <a href="#"> Final Test Maybe </a> </li>
            <li> <a href="#"> Sed venenatis laoreet ligula </a> </li>
        </ul>
    </div>
    <!--close entry-related-->
    {% endcomment %}
{% endblock %}
